package com.team.mr.mrboot.controller;


import com.team.mr.mrboot.entity.Order;
import com.team.mr.mrboot.result.ResponseData;
import com.team.mr.mrboot.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Order)表控制层
 *
 * @author makejava
 * @since 2021-06-01 09:05:19
 */
@Api(value = "orderApi")
@RestController
@RequestMapping("order")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private OrderService orderService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Order selectOne(Integer id) {
        return this.orderService.queryById(id);
    }

    @ApiOperation(value = "createOrder" ,notes = "预约美容项目")
    @ApiImplicitParam(name = "order",value = "预约对象")
    @PostMapping("createOrder")
    public ResponseData createOrder(@RequestBody Order order){
        System.out.println("刘浩东冲突！11");
        System.out.println("汪马凯冲突！2");
        System.out.println("陈其博冲突！3");
        System.out.println("黄巧林冲突！4");
        System.out.println("李昱帆冲突！5");
        System.out.println("潘  杨冲突！6");
        System.out.println("马承力冲突！7");

        //刘浩东有问题1
        //汪马凯有问题2
        //陈其博有问题3
        //黄巧林有问题4
        //李昱帆有问题5
        //潘杨有问题6
        //马承力有问题7
        System.out.println("gogogo1");
        System.out.println("gogogo2");
        System.out.println("gogogo3");
        System.out.println("gogogo4");
        System.out.println("gogogo5");
        System.out.println("gogogo6");
        System.out.println("gogogo7");

        return orderService.insert(order);

    }


}